#!/usr/bin/perl
#navigate.cgi

require './web-lib.pl';

&init_config();
&ReadParse();
($curstep, $stepsref) = &get_wizard_conf();
if ($in{'step'} == 0)
{
        $step_str = $text{'welcome_wizard'};
}
elsif ($in{'step'} == (@$stepsref + 1))
{
        $step_str = $text{'finish_wizard'};
}
else
{
        $step_str = &text('step_string', $in{'step'});
}
&header();
print "<form action=setupwiz.cgi target=_top method=post>\n";
print "<table class=mode1 align=center width=98%>\n";
print "<tr><td style=\"font-size:18pt\"><b>$text{'setup_wizard_title'} - $step_str</b><input type=hidden name=step value=$in{'step'}></td>\n";
print "<td align=right>\n";
if ($in{'step'} > 0)
{
        print "<input type=button class=button1 name=backbtn value=\"$text{'back'}\" onclick='set_wizard_step($in{'step'}-1)'>&nbsp;&nbsp;\n";
}
if ($in{'step'} == 0)
{
        print "<input type=button class=button1 name=nextbtn value=\"$text{'start'}\" onclick='set_wizard_step($in{'step'}+1)'></td></tr>\n";
}
elsif ($in{'step'} == (@$stepsref + 1))
{
print "<input type=button class=button1 name=nextbtn value=\"$text{'finish'}\" onclick='top.location=\"\"'></td></tr>\n";
}
else
{
        print "<input type=button class=button1 name=nextbtn value=\"$text{'next'}\" onclick='set_wizard_step($in{'step'}+1)'></td></tr>\n";
}
print "</table></form>\n";

print <<EOF;
<script>
function set_wizard_step(s)
{
        document.forms[0].step.value = s;
        document.forms[0].submit();
}
</script>
EOF

&footer();


